package com.lazyfish.superdir;

import com.lazyfish.superdir.entity.Dir;
import com.lazyfish.superdir.entity.SSHRegisterEntity;
import com.lazyfish.superdir.entity.UbuntuDiyxitop;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;

public class SSHtest {
    @Test
    void SSHBash() throws IOException {
        UbuntuDiyxitop ubuntuDiyxitop = new UbuntuDiyxitop();
        ubuntuDiyxitop.setHost("182.92.98.89");
        ubuntuDiyxitop.setPort(22);
        ubuntuDiyxitop.setUser("root");
        ubuntuDiyxitop.setPassword("xiaoxi123!");
        // 主机1
        SSHRegisterEntity sshRegisterEntity1 = new SSHRegisterEntity(ubuntuDiyxitop);
        StringBuilder stringBuilder1 = sshRegisterEntity1.exec("bypy syncup /opt/testup/ /test");
        System.out.println("测试");
        System.out.println(stringBuilder1.toString());
    }
}
